/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-03-07
 * Time: 11:41
 */
class Solution25 {
    public int getMaxLen(int[] nums) {
        int n = nums.length;
        int result = 0;

        for(int i = 0 ; i < n ; i++){
            int curLength = 0;
            long ret = 1;
            for(int j = i ; j < n ; ){
                ret *= nums[j];
                if(ret > 0){
                    curLength = Math.max(curLength,j-i+1);
                    j++;
                }else if(ret < 0){
                    j++;
                }else {
                    break;
                }
            }
            result = Math.max(curLength,result);
        }
        return result;
    }
}
public class Test25 {

}
